<?php
if ($objective_topic == "")
	$objective_topic = null;

if ($style !== null && $style != "")
	$style = " style='$style'";
else
	$style = "";
?>

<div id=<?php echo "'".$prefix."objective_layer_".$topic_id."'".$style; ?>>
	<?php


echo CHtml::label(Yii::t('project', 'Objective needs'), $prefix . 'objective_needs_' . $topic_id); 
$options = array (
	'id' => $prefix . 'objective_needs_' . $topic_id,
	'cols' => $columns,
	'rows' => $rows,
	'style' => $area_style,
	'class'=>'editor_text'
);
if (!$read_only) {
	echo CHtml::textArea($form_name . "[" . $topic_id . "][objective_needs]", $objective_needs, $options);
	//Yii::app()->clientScript->registerScript($options['id'].'-script', '$("#'.$options['id'].'").wysiwyg();');
} else {
	echo "<div class='editor_text' id='" . $options['id'] . "'>" . $objective_needs . "&nbsp;</div>";
}

echo CHtml::label(Yii::t('project', 'Objective contacts'), $prefix . 'objective_contacts_' . $topic_id);

$options = array (
	'id' => $prefix . 'objective_contacts_' . $topic_id,
	'cols' => $columns,
	'rows' => $rows,
	'style' => $area_style,
	'class' => 'editor_text'
);
if ($read_only)
	$options['readonly'] = true;

if (!$read_only) {
	echo CHtml::textArea($form_name . "[" . $topic_id . "][objective_contacts]", $objective_contacts, $options);
} else {
	echo "<div class='editor_text' id='" . $options['id'] . "'>" . $objective_contacts . "&nbsp;</div>";
}

echo CHtml::hiddenField($form_name . "[" . $topic_id . "][objective]", ($objective == null) ? "0" : $objective, array (
	'id' => $prefix . 'objective_' . $topic_id
)) . CHtml::hiddenField($form_name . "[" . $topic_id . "][objective_topic]", ($objective_topic == null) ? "" : $objective_topic, array (
	'id' => $prefix . 'objective_topic_' . $topic_id
));


?>&nbsp;
</div>